package com.wb.system.service.impl;

import com.wb.common.vo.WwwImagesInfoModel;
import com.wb.system.domain.WwwImagesInfoEntity;
import com.wb.system.domain.WwwInfoModel;
import com.wb.system.mapper.IWwwImagesInfoMapper;
import com.wb.system.service.IWwwImagesInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IWwwImagesInfoServiceImpl implements IWwwImagesInfoService {
    @Autowired
    private IWwwImagesInfoMapper imagesInfoMapper;

    @Override
    public List<WwwImagesInfoEntity> selectWwwInfoList(WwwImagesInfoModel model) {
        return imagesInfoMapper.selectWwwInfoList(model);
    }

    @Override
    public void save(WwwImagesInfoEntity entity) {
        imagesInfoMapper.save(entity);
    }

    @Override
    public WwwImagesInfoEntity getWwwInfoLeast() {
        return imagesInfoMapper.getWwwInfoLeast();
    }

    @Override
    public WwwImagesInfoEntity getWwwInfoDetail(Long id) {
        return imagesInfoMapper.getWwwInfoDetail(id);
    }

    @Override
    public void updateWwwInfoById(WwwImagesInfoEntity wwwImagesInfo) {
        imagesInfoMapper.updateWwwInfoById(wwwImagesInfo);
    }


    @Override
    public void removeVideosByIds(List<Long> ids) {
        if (ids != null && ids.size() > 0) {
            for (Long id : ids) {
                imagesInfoMapper.removeWwwInfoById(id);
            }
        }
    }

    @Override
    public void updateStatus(WwwImagesInfoEntity wwwImagesInfo) {
        imagesInfoMapper.updateWwwInfoById(wwwImagesInfo);
    }
}
